﻿using System;
using System.Collections.Generic;
using Terraria.GameContent.Events;
using Terraria.ID;

namespace Terraria.ModLoader
{
	// Token: 0x020001FE RID: 510
	public class SpawnCondition
	{
		// Token: 0x170001AC RID: 428
		// (get) Token: 0x06001645 RID: 5701 RVA: 0x00010D40 File Offset: 0x0000EF40
		internal IEnumerable<SpawnCondition> Children
		{
			get
			{
				return this.children;
			}
		}

		// Token: 0x170001AD RID: 429
		// (get) Token: 0x06001646 RID: 5702 RVA: 0x00010D48 File Offset: 0x0000EF48
		internal float BlockWeight
		{
			get
			{
				return this.blockWeight;
			}
		}

		// Token: 0x170001AE RID: 430
		// (get) Token: 0x06001647 RID: 5703 RVA: 0x00010D50 File Offset: 0x0000EF50
		public float Chance
		{
			get
			{
				return this.chance;
			}
		}

		// Token: 0x170001AF RID: 431
		// (get) Token: 0x06001648 RID: 5704 RVA: 0x00010D58 File Offset: 0x0000EF58
		public bool Active
		{
			get
			{
				return this.active;
			}
		}

		// Token: 0x06001649 RID: 5705 RVA: 0x00010D60 File Offset: 0x0000EF60
		internal SpawnCondition(Func<NPCSpawnInfo, bool> condition, float blockWeight = 1f)
		{
			this.condition = condition;
			this.children = new List<SpawnCondition>();
			this.blockWeight = blockWeight;
			NPCSpawnHelper.conditions.Add(this);
		}

		// Token: 0x0600164A RID: 5706 RVA: 0x00010D8C File Offset: 0x0000EF8C
		internal SpawnCondition(SpawnCondition parent, Func<NPCSpawnInfo, bool> condition, float blockWeight = 1f)
		{
			this.condition = condition;
			this.children = new List<SpawnCondition>();
			this.blockWeight = blockWeight;
			parent.children.Add(this);
		}

		// Token: 0x0600164B RID: 5707 RVA: 0x00414B58 File Offset: 0x00412D58
		internal void Reset()
		{
			this.chance = 0f;
			this.active = false;
			foreach (SpawnCondition spawnCondition in this.children)
			{
				spawnCondition.Reset();
			}
		}

		// Token: 0x0600164C RID: 5708 RVA: 0x00414BBC File Offset: 0x00412DBC
		internal void Check(NPCSpawnInfo info, ref float remainingWeight)
		{
			if (this.WeightFunc != null)
			{
				this.blockWeight = this.WeightFunc();
			}
			this.active = true;
			if (this.condition(info))
			{
				this.chance = remainingWeight * this.blockWeight;
				float value = this.chance;
				foreach (SpawnCondition spawnCondition in this.children)
				{
					spawnCondition.Check(info, ref value);
					if ((double)Math.Abs(value) < 5E-06)
					{
						break;
					}
				}
				remainingWeight -= this.chance;
			}
		}

		// Token: 0x0600164D RID: 5709 RVA: 0x00414C74 File Offset: 0x00412E74
		static SpawnCondition()
		{
			SpawnCondition.Wraith.WeightFunc = delegate
			{
				float num = 0.95f;
				if (Main.moonPhase == 4)
				{
					num *= 0.8f;
				}
				return 1f - num;
			};
			SpawnCondition.HoppinJack = new SpawnCondition((NPCSpawnInfo info) => Main.hardMode && Main.halloween && (double)info.spawnTileY <= Main.worldSurface && !Main.dayTime, 0.1f);
			SpawnCondition.DoctorBones = new SpawnCondition((NPCSpawnInfo info) => info.spawnTileType == 60 && !Main.dayTime, 0.002f);
			SpawnCondition.LacBeetle = new SpawnCondition((NPCSpawnInfo info) => info.spawnTileType == 60 && (double)info.spawnTileY > Main.worldSurface, 0.0166666675f);
			SpawnCondition.WormCritter = new SpawnCondition((NPCSpawnInfo info) => (double)info.spawnTileY > Main.worldSurface && info.spawnTileY < Main.maxTilesY - 210 && !info.player.ZoneSnow && !info.player.ZoneCrimson && !info.player.ZoneCorrupt && !info.player.ZoneJungle && !info.player.ZoneHoly, 0.125f);
			SpawnCondition.MouseCritter = new SpawnCondition((NPCSpawnInfo info) => (double)info.spawnTileY > Main.worldSurface && info.spawnTileY < Main.maxTilesY - 210 && !info.player.ZoneSnow && !info.player.ZoneCrimson && !info.player.ZoneCorrupt && !info.player.ZoneJungle && !info.player.ZoneHoly, 0.07692308f);
			SpawnCondition.SnailCritter = new SpawnCondition((NPCSpawnInfo info) => (double)info.spawnTileY > Main.worldSurface && (double)info.spawnTileY < (Main.rockLayer + (double)Main.maxTilesY) / 2.0 && !info.player.ZoneSnow && !info.player.ZoneCrimson && !info.player.ZoneCorrupt && !info.player.ZoneHoly, 0.07692308f);
			SpawnCondition.FrogCritter = new SpawnCondition((NPCSpawnInfo info) => (double)info.spawnTileY < Main.worldSurface && info.player.ZoneJungle, 0.111111112f);
			SpawnCondition.HardmodeJungle = new SpawnCondition((NPCSpawnInfo info) => info.spawnTileType == 60 && Main.hardMode, 0.6666667f);
			SpawnCondition.JungleTemple = new SpawnCondition((NPCSpawnInfo info) => info.spawnTileType == 226 && info.lihzahrd, 1f);
			SpawnCondition.UndergroundJungle = new SpawnCondition((NPCSpawnInfo info) => info.spawnTileType == 60 && (double)info.spawnTileY > (Main.worldSurface + Main.rockLayer) / 2.0, 1f);
			SpawnCondition.SurfaceJungle = new SpawnCondition((NPCSpawnInfo info) => info.spawnTileType == 60, 0.34375f);
			SpawnCondition.SandstormEvent = new SpawnCondition((NPCSpawnInfo info) => Sandstorm.Happening && info.player.ZoneSandstorm && TileID.Sets.Conversion.Sand[info.spawnTileType] && NPC.Spawning_SandstoneCheck(info.spawnTileX, info.spawnTileY), 1f);
			SpawnCondition.Mummy = new SpawnCondition((NPCSpawnInfo info) => Main.hardMode && info.spawnTileType == 53, 0.333333343f);
			SpawnCondition.DarkMummy = new SpawnCondition((NPCSpawnInfo info) => Main.hardMode && (info.spawnTileType == 112 || info.spawnTileType == 234), 0.5f);
			SpawnCondition.LightMummy = new SpawnCondition((NPCSpawnInfo info) => Main.hardMode && info.spawnTileType == 116, 0.5f);
			SpawnCondition.OverworldHallow = new SpawnCondition((NPCSpawnInfo info) => Main.hardMode && !info.water && (double)info.spawnTileY < Main.rockLayer && (info.spawnTileType == 116 || info.spawnTileType == 117 || info.spawnTileType == 109 || info.spawnTileType == 164), 1f);
			SpawnCondition.EnchantedSword = new SpawnCondition((NPCSpawnInfo info) => !info.playerSafe && Main.hardMode && !info.water && (double)info.spawnTileY >= Main.rockLayer && (info.spawnTileType == 116 || info.spawnTileType == 117 || info.spawnTileType == 109 || info.spawnTileType == 164), 0.02f);
			SpawnCondition.Crimson = new SpawnCondition((NPCSpawnInfo info) => (info.spawnTileType == 204 && info.player.ZoneCrimson) || info.spawnTileType == 199 || info.spawnTileType == 200 || info.spawnTileType == 203 || info.spawnTileType == 234, 1f);
			SpawnCondition.Corruption = new SpawnCondition((NPCSpawnInfo info) => (info.spawnTileType == 22 && info.player.ZoneCorrupt) || info.spawnTileType == 23 || info.spawnTileType == 25 || info.spawnTileType == 112 || info.spawnTileType == 163, 1f);
			SpawnCondition.Overworld = new SpawnCondition((NPCSpawnInfo info) => (double)info.spawnTileY <= Main.worldSurface, 1f);
			SpawnCondition.IceGolem = new SpawnCondition(SpawnCondition.Overworld, (NPCSpawnInfo info) => info.player.ZoneSnow && Main.hardMode && Main.cloudAlpha > 0f && !NPC.AnyNPCs(243), 0.05f);
			SpawnCondition.RainbowSlime = new SpawnCondition(SpawnCondition.Overworld, (NPCSpawnInfo info) => info.player.ZoneHoly && Main.hardMode && Main.cloudAlpha > 0f && !NPC.AnyNPCs(244), 0.05f);
			SpawnCondition.AngryNimbus = new SpawnCondition(SpawnCondition.Overworld, (NPCSpawnInfo info) => !info.player.ZoneSnow && Main.hardMode && Main.cloudAlpha > 0f && NPC.CountNPCS(250) < 2, 0.1f);
			SpawnCondition.MartianProbe = new SpawnCondition(SpawnCondition.Overworld, (NPCSpawnInfo info) => SpawnCondition.MartianProbeHelper(info) && Main.hardMode && NPC.downedGolemBoss && !NPC.AnyNPCs(399), 0.0025f);
			SpawnCondition.MartianProbe.WeightFunc = delegate
			{
				float num = 0.9975f;
				if (!NPC.downedMartians)
				{
					num *= 0.99f;
				}
				return 1f - num;
			};
			SpawnCondition.OverworldDay = new SpawnCondition(SpawnCondition.Overworld, (NPCSpawnInfo info) => Main.dayTime, 1f);
			SpawnCondition.OverworldDaySnowCritter = new SpawnCondition(SpawnCondition.OverworldDay, (NPCSpawnInfo info) => SpawnCondition.InnerThird(info) && (SpawnCondition.GetTile(info).type == 147 || SpawnCondition.GetTile(info).type == 161), 0.06666667f);
			SpawnCondition.OverworldDayGrassCritter = new SpawnCondition(SpawnCondition.OverworldDay, (NPCSpawnInfo info) => SpawnCondition.InnerThird(info) && (SpawnCondition.GetTile(info).type == 2 || SpawnCondition.GetTile(info).type == 109), 0.06666667f);
			SpawnCondition.OverworldDaySandCritter = new SpawnCondition(SpawnCondition.OverworldDay, (NPCSpawnInfo info) => SpawnCondition.InnerThird(info) && SpawnCondition.GetTile(info).type == 53, 0.06666667f);
			SpawnCondition.OverworldMorningBirdCritter = new SpawnCondition(SpawnCondition.OverworldDay, (NPCSpawnInfo info) => SpawnCondition.InnerThird(info) && Main.time < 18000.0 && (SpawnCondition.GetTile(info).type == 2 || SpawnCondition.GetTile(info).type == 109), 0.25f);
			SpawnCondition.OverworldDayBirdCritter = new SpawnCondition(SpawnCondition.OverworldDay, (NPCSpawnInfo info) => SpawnCondition.InnerThird(info) && (SpawnCondition.GetTile(info).type == 2 || SpawnCondition.GetTile(info).type == 109 || SpawnCondition.GetTile(info).type == 147), 0.06666667f);
			SpawnCondition.KingSlime = new SpawnCondition(SpawnCondition.OverworldDay, (NPCSpawnInfo info) => SpawnCondition.OuterThird(info) && SpawnCondition.GetTile(info).type == 2 && !NPC.AnyNPCs(50), 0.00333333341f);
			SpawnCondition.OverworldDayDesert = new SpawnCondition(SpawnCondition.OverworldDay, (NPCSpawnInfo info) => SpawnCondition.GetTile(info).type == 53 && !info.water, 0.2f);
			SpawnCondition.GoblinScout = new SpawnCondition(SpawnCondition.OverworldDay, (NPCSpawnInfo info) => SpawnCondition.OuterThird(info), 0.06666667f);
			SpawnCondition.GoblinScout.WeightFunc = delegate
			{
				float num = 0.933333337f;
				if (!NPC.downedGoblins && WorldGen.shadowOrbSmashed)
				{
					return num * 0.857142866f;
				}
				return 1f - num;
			};
			SpawnCondition.OverworldDayRain = new SpawnCondition(SpawnCondition.OverworldDay, (NPCSpawnInfo info) => Main.raining, 0.6666667f);
			SpawnCondition.OverworldDaySlime = new SpawnCondition(SpawnCondition.OverworldDay, (NPCSpawnInfo info) => true, 1f);
			SpawnCondition.OverworldNight = new SpawnCondition(SpawnCondition.Overworld, (NPCSpawnInfo info) => true, 1f);
			SpawnCondition.OverworldFirefly = new SpawnCondition(SpawnCondition.OverworldNight, (NPCSpawnInfo info) => SpawnCondition.GetTile(info).type == 2 || SpawnCondition.GetTile(info).type == 109, 0.1f);
			SpawnCondition.OverworldFirefly.WeightFunc = (() => 1f / (float)NPC.fireFlyChance);
			SpawnCondition.OverworldNightMonster = new SpawnCondition(SpawnCondition.OverworldNight, (NPCSpawnInfo info) => true, 1f);
			SpawnCondition.Underground = new SpawnCondition((NPCSpawnInfo info) => (double)info.spawnTileY <= Main.rockLayer, 1f);
			SpawnCondition.Underworld = new SpawnCondition((NPCSpawnInfo info) => info.spawnTileY > Main.maxTilesY - 190, 1f);
			SpawnCondition.Cavern = new SpawnCondition((NPCSpawnInfo info) => true, 1f);
		}

		// Token: 0x0600164E RID: 5710 RVA: 0x00010DB9 File Offset: 0x0000EFB9
		private static Tile GetTile(NPCSpawnInfo info)
		{
			return Main.tile[info.spawnTileX, info.spawnTileY];
		}

		// Token: 0x0600164F RID: 5711 RVA: 0x00415908 File Offset: 0x00413B08
		private static bool WaterSurface(NPCSpawnInfo info)
		{
			if (info.safeRangeX)
			{
				return false;
			}
			for (int i = info.spawnTileY - 1; i > info.spawnTileY - 50; i--)
			{
				if (Main.tile[info.spawnTileX, i].liquid == 0 && !WorldGen.SolidTile(info.spawnTileX, i) && !WorldGen.SolidTile(info.spawnTileX, i + 1) && !WorldGen.SolidTile(info.spawnTileX, i + 2))
				{
					return true;
				}
			}
			return false;
		}

		// Token: 0x06001650 RID: 5712 RVA: 0x00010DD1 File Offset: 0x0000EFD1
		private static bool MartianProbeHelper(NPCSpawnInfo info)
		{
			return (float)Math.Abs(info.spawnTileX - Main.maxTilesX / 2) / (float)(Main.maxTilesX / 2) > 0.33f && !NPC.AnyDanger();
		}

		// Token: 0x06001651 RID: 5713 RVA: 0x00010E01 File Offset: 0x0000F001
		private static bool InnerThird(NPCSpawnInfo info)
		{
			return Math.Abs(info.spawnTileX - Main.spawnTileX) < Main.maxTilesX / 3;
		}

		// Token: 0x06001652 RID: 5714 RVA: 0x00010E1D File Offset: 0x0000F01D
		private static bool OuterThird(NPCSpawnInfo info)
		{
			return Math.Abs(info.spawnTileX - Main.spawnTileX) > Main.maxTilesX / 3;
		}

		// Token: 0x0400153F RID: 5439
		private Func<NPCSpawnInfo, bool> condition;

		// Token: 0x04001540 RID: 5440
		private List<SpawnCondition> children;

		// Token: 0x04001541 RID: 5441
		private float blockWeight;

		// Token: 0x04001542 RID: 5442
		internal Func<float> WeightFunc;

		// Token: 0x04001543 RID: 5443
		private float chance;

		// Token: 0x04001544 RID: 5444
		private bool active;

		// Token: 0x04001545 RID: 5445
		public static readonly SpawnCondition NebulaTower = new SpawnCondition((NPCSpawnInfo info) => info.player.ZoneTowerNebula, 1f);

		// Token: 0x04001546 RID: 5446
		public static readonly SpawnCondition VortexTower = new SpawnCondition((NPCSpawnInfo info) => info.player.ZoneTowerVortex, 1f);

		// Token: 0x04001547 RID: 5447
		public static readonly SpawnCondition StardustTower = new SpawnCondition((NPCSpawnInfo info) => info.player.ZoneTowerStardust, 1f);

		// Token: 0x04001548 RID: 5448
		public static readonly SpawnCondition SolarTower = new SpawnCondition((NPCSpawnInfo info) => info.player.ZoneTowerSolar, 1f);

		// Token: 0x04001549 RID: 5449
		public static readonly SpawnCondition Sky = new SpawnCondition((NPCSpawnInfo info) => info.sky, 1f);

		// Token: 0x0400154A RID: 5450
		public static readonly SpawnCondition Invasion = new SpawnCondition((NPCSpawnInfo info) => info.invasion, 1f);

		// Token: 0x0400154B RID: 5451
		public static readonly SpawnCondition GoblinArmy = new SpawnCondition(SpawnCondition.Invasion, (NPCSpawnInfo info) => Main.invasionType == 1, 1f);

		// Token: 0x0400154C RID: 5452
		public static readonly SpawnCondition FrostLegion = new SpawnCondition(SpawnCondition.Invasion, (NPCSpawnInfo info) => Main.invasionType == 2, 1f);

		// Token: 0x0400154D RID: 5453
		public static readonly SpawnCondition Pirates = new SpawnCondition(SpawnCondition.Invasion, (NPCSpawnInfo info) => Main.invasionType == 3, 1f);

		// Token: 0x0400154E RID: 5454
		public static readonly SpawnCondition MartianMadness = new SpawnCondition(SpawnCondition.Invasion, (NPCSpawnInfo info) => Main.invasionType == 4, 1f);

		// Token: 0x0400154F RID: 5455
		public static readonly SpawnCondition Bartender = new SpawnCondition((NPCSpawnInfo info) => !NPC.savedBartender && DD2Event.ReadyToFindBartender && !NPC.AnyNPCs(579) && !info.water, 0.0125f);

		// Token: 0x04001550 RID: 5456
		public static readonly SpawnCondition SpiderCave = new SpawnCondition((NPCSpawnInfo info) => SpawnCondition.GetTile(info).wall == 62 || info.spiderCave, 1f);

		// Token: 0x04001551 RID: 5457
		public static readonly SpawnCondition DesertCave = new SpawnCondition((NPCSpawnInfo info) => (WallID.Sets.Conversion.HardenedSand[(int)SpawnCondition.GetTile(info).wall] || WallID.Sets.Conversion.Sandstone[(int)SpawnCondition.GetTile(info).wall] || info.desertCave) && WorldGen.checkUnderground(info.spawnTileX, info.spawnTileY), 1f);

		// Token: 0x04001552 RID: 5458
		public static readonly SpawnCondition HardmodeJungleWater = new SpawnCondition((NPCSpawnInfo info) => Main.hardMode && info.water && info.player.ZoneJungle, 0.6666667f);

		// Token: 0x04001553 RID: 5459
		public static readonly SpawnCondition HardmodeCrimsonWater = new SpawnCondition((NPCSpawnInfo info) => Main.hardMode && info.water && info.player.ZoneCrimson, 0.8888889f);

		// Token: 0x04001554 RID: 5460
		public static readonly SpawnCondition Ocean = new SpawnCondition((NPCSpawnInfo info) => info.water && (info.spawnTileX < 250 || info.spawnTileX > Main.maxTilesX - 250) && Main.tileSand[info.spawnTileType] && (double)info.spawnTileY < Main.rockLayer, 1f);

		// Token: 0x04001555 RID: 5461
		public static readonly SpawnCondition OceanAngler = new SpawnCondition(SpawnCondition.Ocean, (NPCSpawnInfo info) => !NPC.savedAngler && !NPC.AnyNPCs(376) && SpawnCondition.WaterSurface(info), 1f);

		// Token: 0x04001556 RID: 5462
		public static readonly SpawnCondition OceanMonster = new SpawnCondition(SpawnCondition.Ocean, (NPCSpawnInfo info) => true, 1f);

		// Token: 0x04001557 RID: 5463
		public static readonly SpawnCondition BeachAngler = new SpawnCondition((NPCSpawnInfo info) => !info.water && !NPC.savedAngler && !NPC.AnyNPCs(376) && (info.spawnTileX < 340 || info.spawnTileX > Main.maxTilesX - 340) && Main.tileSand[info.spawnTileType] && (double)info.spawnTileY < Main.worldSurface, 1f);

		// Token: 0x04001558 RID: 5464
		public static readonly SpawnCondition JungleWater = new SpawnCondition((NPCSpawnInfo info) => info.water && info.spawnTileType == 60, 1f);

		// Token: 0x04001559 RID: 5465
		public static readonly SpawnCondition CavePiranha = new SpawnCondition((NPCSpawnInfo info) => info.water && (double)info.spawnTileY > Main.rockLayer, 0.5f);

		// Token: 0x0400155A RID: 5466
		public static readonly SpawnCondition CaveJellyfish = new SpawnCondition((NPCSpawnInfo info) => info.water && (double)info.spawnTileY > Main.worldSurface, 0.333333343f);

		// Token: 0x0400155B RID: 5467
		public static readonly SpawnCondition WaterCritter = new SpawnCondition((NPCSpawnInfo info) => info.water, 0.25f);

		// Token: 0x0400155C RID: 5468
		public static readonly SpawnCondition CorruptWaterCritter = new SpawnCondition(SpawnCondition.WaterCritter, (NPCSpawnInfo info) => info.player.ZoneCorrupt, 1f);

		// Token: 0x0400155D RID: 5469
		public static readonly SpawnCondition OverworldWaterCritter = new SpawnCondition(SpawnCondition.WaterCritter, (NPCSpawnInfo info) => (double)info.spawnTileY < Main.worldSurface && info.spawnTileY > 50 && Main.dayTime, 0.6666667f);

		// Token: 0x0400155E RID: 5470
		public static readonly SpawnCondition OverworldWaterSurfaceCritter = new SpawnCondition(SpawnCondition.OverworldWaterCritter, new Func<NPCSpawnInfo, bool>(SpawnCondition.WaterSurface), 1f);

		// Token: 0x0400155F RID: 5471
		public static readonly SpawnCondition OverworldUnderwaterCritter = new SpawnCondition(SpawnCondition.OverworldWaterCritter, (NPCSpawnInfo info) => true, 1f);

		// Token: 0x04001560 RID: 5472
		public static readonly SpawnCondition DefaultWaterCritter = new SpawnCondition(SpawnCondition.WaterCritter, (NPCSpawnInfo info) => true, 1f);

		// Token: 0x04001561 RID: 5473
		public static readonly SpawnCondition BoundCaveNPC = new SpawnCondition((NPCSpawnInfo info) => !info.water && (double)info.spawnTileY >= Main.rockLayer && info.spawnTileY < Main.maxTilesY - 210, 0.05f);

		// Token: 0x04001562 RID: 5474
		public static readonly SpawnCondition TownCritter = new SpawnCondition((NPCSpawnInfo info) => info.playerInTown, 1f);

		// Token: 0x04001563 RID: 5475
		public static readonly SpawnCondition TownWaterCritter = new SpawnCondition(SpawnCondition.TownCritter, (NPCSpawnInfo info) => info.water, 1f);

		// Token: 0x04001564 RID: 5476
		public static readonly SpawnCondition TownOverworldWaterCritter = new SpawnCondition(SpawnCondition.TownWaterCritter, (NPCSpawnInfo info) => (double)info.spawnTileY < Main.worldSurface && info.spawnTileY > 50 && Main.dayTime, 0.6666667f);

		// Token: 0x04001565 RID: 5477
		public static readonly SpawnCondition TownOverworldWaterSurfaceCritter = new SpawnCondition(SpawnCondition.TownOverworldWaterCritter, new Func<NPCSpawnInfo, bool>(SpawnCondition.WaterSurface), 1f);

		// Token: 0x04001566 RID: 5478
		public static readonly SpawnCondition TownOverworldUnderwaterCritter = new SpawnCondition(SpawnCondition.TownOverworldWaterCritter, (NPCSpawnInfo info) => true, 1f);

		// Token: 0x04001567 RID: 5479
		public static readonly SpawnCondition TownDefaultWaterCritter = new SpawnCondition(SpawnCondition.TownWaterCritter, (NPCSpawnInfo info) => true, 1f);

		// Token: 0x04001568 RID: 5480
		public static readonly SpawnCondition TownSnowCritter = new SpawnCondition(SpawnCondition.TownCritter, (NPCSpawnInfo info) => info.spawnTileType == 147 || info.spawnTileType == 161, 1f);

		// Token: 0x04001569 RID: 5481
		public static readonly SpawnCondition TownJungleCritter = new SpawnCondition(SpawnCondition.TownCritter, (NPCSpawnInfo info) => info.spawnTileType == 60, 1f);

		// Token: 0x0400156A RID: 5482
		public static readonly SpawnCondition TownGeneralCritter = new SpawnCondition(SpawnCondition.TownCritter, (NPCSpawnInfo info) => info.spawnTileType == 2 || info.spawnTileType == 109 || (double)info.spawnTileY > Main.worldSurface, 1f);

		// Token: 0x0400156B RID: 5483
		public static readonly SpawnCondition Dungeon = new SpawnCondition((NPCSpawnInfo info) => info.player.ZoneDungeon, 1f);

		// Token: 0x0400156C RID: 5484
		public static readonly SpawnCondition DungeonGuardian = new SpawnCondition(SpawnCondition.Dungeon, (NPCSpawnInfo info) => !NPC.downedBoss3, 1f);

		// Token: 0x0400156D RID: 5485
		public static readonly SpawnCondition DungeonNormal = new SpawnCondition(SpawnCondition.Dungeon, (NPCSpawnInfo info) => true, 1f);

		// Token: 0x0400156E RID: 5486
		public static readonly SpawnCondition Meteor = new SpawnCondition((NPCSpawnInfo info) => info.player.ZoneMeteor, 1f);

		// Token: 0x0400156F RID: 5487
		public static readonly SpawnCondition OldOnesArmy = new SpawnCondition((NPCSpawnInfo info) => DD2Event.Ongoing && info.player.ZoneOldOneArmy, 1f);

		// Token: 0x04001570 RID: 5488
		public static readonly SpawnCondition FrostMoon = new SpawnCondition((NPCSpawnInfo info) => (double)info.spawnTileY <= Main.worldSurface && !Main.dayTime && Main.snowMoon, 1f);

		// Token: 0x04001571 RID: 5489
		public static readonly SpawnCondition PumpkinMoon = new SpawnCondition((NPCSpawnInfo info) => (double)info.spawnTileY <= Main.worldSurface && !Main.dayTime && Main.pumpkinMoon, 1f);

		// Token: 0x04001572 RID: 5490
		public static readonly SpawnCondition SolarEclipse = new SpawnCondition((NPCSpawnInfo info) => (double)info.spawnTileY <= Main.worldSurface && Main.dayTime && Main.eclipse, 1f);

		// Token: 0x04001573 RID: 5491
		public static readonly SpawnCondition HardmodeMushroomWater = new SpawnCondition((NPCSpawnInfo info) => Main.hardMode && info.spawnTileType == 70 && info.water, 1f);

		// Token: 0x04001574 RID: 5492
		public static readonly SpawnCondition OverworldMushroom = new SpawnCondition((NPCSpawnInfo info) => info.spawnTileType == 70 && (double)info.spawnTileY <= Main.worldSurface, 0.6666667f);

		// Token: 0x04001575 RID: 5493
		public static readonly SpawnCondition UndergroundMushroom = new SpawnCondition((NPCSpawnInfo info) => info.spawnTileType == 70 && Main.hardMode && (double)info.spawnTileY >= Main.worldSurface, 0.6666667f);

		// Token: 0x04001576 RID: 5494
		public static readonly SpawnCondition CorruptWorm = new SpawnCondition((NPCSpawnInfo info) => info.player.ZoneCorrupt && !info.playerSafe, 0.0153846154f);

		// Token: 0x04001577 RID: 5495
		public static readonly SpawnCondition UndergroundMimic = new SpawnCondition((NPCSpawnInfo info) => Main.hardMode && (double)info.spawnTileY > Main.worldSurface, 0.0142857144f);

		// Token: 0x04001578 RID: 5496
		public static readonly SpawnCondition OverworldMimic = new SpawnCondition((NPCSpawnInfo info) => Main.hardMode && SpawnCondition.GetTile(info).wall == 2, 0.05f);

		// Token: 0x04001579 RID: 5497
		public static readonly SpawnCondition Wraith = new SpawnCondition((NPCSpawnInfo info) => Main.hardMode && (double)info.spawnTileY <= Main.worldSurface && !Main.dayTime, 0.05f);

		// Token: 0x0400157A RID: 5498
		public static readonly SpawnCondition HoppinJack;

		// Token: 0x0400157B RID: 5499
		public static readonly SpawnCondition DoctorBones;

		// Token: 0x0400157C RID: 5500
		public static readonly SpawnCondition LacBeetle;

		// Token: 0x0400157D RID: 5501
		public static readonly SpawnCondition WormCritter;

		// Token: 0x0400157E RID: 5502
		public static readonly SpawnCondition MouseCritter;

		// Token: 0x0400157F RID: 5503
		public static readonly SpawnCondition SnailCritter;

		// Token: 0x04001580 RID: 5504
		public static readonly SpawnCondition FrogCritter;

		// Token: 0x04001581 RID: 5505
		public static readonly SpawnCondition HardmodeJungle;

		// Token: 0x04001582 RID: 5506
		public static readonly SpawnCondition JungleTemple;

		// Token: 0x04001583 RID: 5507
		public static readonly SpawnCondition UndergroundJungle;

		// Token: 0x04001584 RID: 5508
		public static readonly SpawnCondition SurfaceJungle;

		// Token: 0x04001585 RID: 5509
		public static readonly SpawnCondition SandstormEvent;

		// Token: 0x04001586 RID: 5510
		public static readonly SpawnCondition Mummy;

		// Token: 0x04001587 RID: 5511
		public static readonly SpawnCondition DarkMummy;

		// Token: 0x04001588 RID: 5512
		public static readonly SpawnCondition LightMummy;

		// Token: 0x04001589 RID: 5513
		public static readonly SpawnCondition OverworldHallow;

		// Token: 0x0400158A RID: 5514
		public static readonly SpawnCondition EnchantedSword;

		// Token: 0x0400158B RID: 5515
		public static readonly SpawnCondition Crimson;

		// Token: 0x0400158C RID: 5516
		public static readonly SpawnCondition Corruption;

		// Token: 0x0400158D RID: 5517
		public static readonly SpawnCondition Overworld;

		// Token: 0x0400158E RID: 5518
		public static readonly SpawnCondition IceGolem;

		// Token: 0x0400158F RID: 5519
		public static readonly SpawnCondition RainbowSlime;

		// Token: 0x04001590 RID: 5520
		public static readonly SpawnCondition AngryNimbus;

		// Token: 0x04001591 RID: 5521
		public static readonly SpawnCondition MartianProbe;

		// Token: 0x04001592 RID: 5522
		public static readonly SpawnCondition OverworldDay;

		// Token: 0x04001593 RID: 5523
		public static readonly SpawnCondition OverworldDaySnowCritter;

		// Token: 0x04001594 RID: 5524
		public static readonly SpawnCondition OverworldDayGrassCritter;

		// Token: 0x04001595 RID: 5525
		public static readonly SpawnCondition OverworldDaySandCritter;

		// Token: 0x04001596 RID: 5526
		public static readonly SpawnCondition OverworldMorningBirdCritter;

		// Token: 0x04001597 RID: 5527
		public static readonly SpawnCondition OverworldDayBirdCritter;

		// Token: 0x04001598 RID: 5528
		public static readonly SpawnCondition KingSlime;

		// Token: 0x04001599 RID: 5529
		public static readonly SpawnCondition OverworldDayDesert;

		// Token: 0x0400159A RID: 5530
		public static readonly SpawnCondition GoblinScout;

		// Token: 0x0400159B RID: 5531
		public static readonly SpawnCondition OverworldDayRain;

		// Token: 0x0400159C RID: 5532
		public static readonly SpawnCondition OverworldDaySlime;

		// Token: 0x0400159D RID: 5533
		public static readonly SpawnCondition OverworldNight;

		// Token: 0x0400159E RID: 5534
		public static readonly SpawnCondition OverworldFirefly;

		// Token: 0x0400159F RID: 5535
		public static readonly SpawnCondition OverworldNightMonster;

		// Token: 0x040015A0 RID: 5536
		public static readonly SpawnCondition Underground;

		// Token: 0x040015A1 RID: 5537
		public static readonly SpawnCondition Underworld;

		// Token: 0x040015A2 RID: 5538
		public static readonly SpawnCondition Cavern;
	}
}
